package com.atguigu.lease.web.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.lease.model.entity.CityInfo;
import com.atguigu.lease.web.app.service.CityInfoService;
import com.atguigu.lease.web.app.mapper.CityInfoMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liubo
 * @description 针对表【city_info】的数据库操作Service实现
 * @createDate 2023-07-26 11:12:39
 */
@Service
public class CityInfoServiceImpl extends ServiceImpl<CityInfoMapper, CityInfo>
        implements CityInfoService {

    /**
     * 根据省份id查询信息列表
     *
     * @param id
     * @return
     */
    @Override
    public List<CityInfo> listCityInfoByProvinceId(Long id) {
        LambdaQueryWrapper<CityInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CityInfo::getProvinceId, id);
        List<CityInfo> list = baseMapper.selectList(queryWrapper);
        return list;
    }
}




